﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converters="using:Sumc.Client.ModernUI.Converters">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///Common/StandardStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
    <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <converters:IEnumerableToFirstItemConverter x:Key="GetFirstElement" />
    <converters:TransportTypeToCyrillicConverter x:Key="TransportTypeToCyrillicConverter" />
    <converters:TransportTypeToImageConverter x:Key="TransportTypeToImageConverter" />
    <converters:IEnumerableToFirstItemConverter x:Key="GetElement" />
    <converters:ResultCountToVisibilityConverter x:Key="ResultCountToVisibilityConverter" />
    <converters:EnumerationToTextConverter x:Key="EnumerationToTextConverter" />
    <converters:InvertBooleanConverter x:Key="InvertBooleanConverter" />
    <converters:UppercaseConverter x:Key="UppercaseConverter" />

    <ImageBrush x:Key="Background" Stretch="UniformToFill" ImageSource="ms-appx:///Assets/Background.jpg" AlignmentY="Top" AlignmentX="Center"/>
    <SolidColorBrush Color="#f6f6f6" x:Key="DefaultWhiteBrush" />
    <SolidColorBrush Color="Black" x:Key="DefaultDarkBrush" />
    <SolidColorBrush Color="#3a66e4" x:Key="DefaultItemBackground" />

    <Style x:Key="HomeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
        <Setter Property="AutomationProperties.AutomationId" Value="HomeAppBarButton"/>
        <Setter Property="AutomationProperties.Name" x:Uid="IconHome" Value="" />
        <Setter Property="Content" Value="&#xE10F;"/>
    </Style>

    <Style x:Key="PinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
        <Setter Property="AutomationProperties.AutomationId" Value="PinAppBarButton"/>
        <Setter Property="AutomationProperties.Name" x:Uid="IconPin" Value="Добави"/>
        <Setter Property="Content" Value="&#xE141;"/>
    </Style>

    <Style x:Key="UnPinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
        <Setter Property="AutomationProperties.AutomationId" Value="UnPinAppBarButton"/>
        <Setter Property="AutomationProperties.Name" x:Uid="IconRemove" Value=""/>
        <Setter Property="Content" Value="&#xE196;"/>
    </Style>
    <Style x:Key="ListViewItemTimes" TargetType="ListViewItem">
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="-5"/>
    </Style>

    <Style x:Key="RefreshAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
        <Setter Property="AutomationProperties.AutomationId" Value="RefreshAppBarButton"/>
        <Setter Property="AutomationProperties.Name" Value=""/>
        <Setter Property="Content" Value="&#xE117;"/>
    </Style>
    
    <Style x:Key="SaveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
        <Setter Property="AutomationProperties.AutomationId" Value="SaveAppBarButton"/>
        <Setter Property="AutomationProperties.Name" x:Uid="IconSave" Value="Запази"/>
        <Setter Property="Content" Value="&#xE105;"/>
    </Style>

    <Style x:Key="GoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
        <Setter Property="AutomationProperties.AutomationId" Value="GoAppBarButton"/>
        <Setter Property="AutomationProperties.Name" x:Uid="IconGo" Value="Точно време"/>
        <Setter Property="Content" Value="&#xE143;"/>
    </Style>

    <Style x:Key="ProgressBar" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{StaticResource DefaultItemBackground}" />
    </Style>

    <Style x:Key="PageProgressBar" TargetType="ProgressBar" BasedOn="{StaticResource ProgressBar}">
        <Setter Property="Width" Value="300" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Margin" Value="0,10,0,0" />
    </Style>

    <Style x:Key="ListViewItemSomething" TargetType="ListViewItem">
        <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
        <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="TabNavigation" Value="Local"/>
        <Setter Property="IsHoldingEnabled" Value="True"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListViewItem">
                    <Border x:Name="OuterContainer">
                        <VisualStateManager.VisualStateGroups/>
                        <Grid x:Name="ReorderHintContent" Background="Transparent">
                            <Border x:Name="ContentContainer">
                                <Grid x:Name="InnerDragContent">
                                    <Grid Background="{TemplateBinding Background}">
                                        <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" VerticalAlignment="Center"/>
                                    </Grid>
                                </Grid>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="GridViewWithoutScroll" TargetType="GridView">
        <Setter Property="Padding" Value="0,0,0,10"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="TabNavigation" Value="Once"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled"/>
        <Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False"/>
        <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled"/>
        <Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False"/>
        <Setter Property="ScrollViewer.ZoomMode" Value="Disabled"/>
        <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
        <Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True"/>
        <Setter Property="IsSwipeEnabled" Value="True"/>
        <Setter Property="ItemContainerTransitions">
            <Setter.Value>
                <TransitionCollection>
                    <AddDeleteThemeTransition/>
                    <ContentThemeTransition/>
                    <ReorderThemeTransition/>
                    <EntranceThemeTransition IsStaggeringEnabled="False"/>
                </TransitionCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <WrapGrid Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridView">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <ItemsPresenter HeaderTemplate="{TemplateBinding HeaderTemplate}" Header="{TemplateBinding Header}" HeaderTransitions="{TemplateBinding HeaderTransitions}" Padding="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ListViewWithoutScroller" TargetType="ListView">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="TabNavigation" Value="Once"/>
        <Setter Property="IsSwipeEnabled" Value="True"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
        <Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False"/>
        <Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled"/>
        <Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False"/>
        <Setter Property="ScrollViewer.ZoomMode" Value="Disabled"/>
        <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
        <Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True"/>
        <Setter Property="ItemContainerTransitions">
            <Setter.Value>
                <TransitionCollection>
                    <AddDeleteThemeTransition/>
                    <ContentThemeTransition/>
                    <ReorderThemeTransition/>
                    <EntranceThemeTransition IsStaggeringEnabled="False"/>
                </TransitionCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListView">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <ItemsPresenter HeaderTemplate="{TemplateBinding HeaderTemplate}" Header="{TemplateBinding Header}" HeaderTransitions="{TemplateBinding HeaderTransitions}" Padding="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
